package com.top.application.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.top.application.dao.UserEntityMapper;
import com.top.application.dao.UserRoleEntityMapper;
import com.top.application.entity.UserEntity;
import com.top.application.service.UserService;

/**
 * 
 * @ClassName: UserServiceImpl 
 * @Description: TODO(用户管理业务层) 
 * @author zhaiey
 * @date 2018年3月30日 上午10:50:09 
 *
 */
@Service("userService")
public class UserServiceImpl implements UserService{

	@Autowired
	private UserEntityMapper userMapper;
	
	@Autowired
	private UserRoleEntityMapper userRoleMapper;
	
	@Override
	public int delete(Integer id) {
		return userMapper.delete(id);
	}

	@Override
	public int insert(UserEntity record) {
		return userMapper.insert(record);
	}

	@Override
	public UserEntity selectById(Integer id) {
		return userMapper.selectById(id);
	}

	@Override
	public int update(UserEntity record) {
		return userMapper.update(record);
	}

	@Override
	public UserEntity getByUserName(String username) {
		UserEntity userEntity = userMapper.getByUserName(username);
		return userEntity;
	}

}
